<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>博客详情页</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/blog_detail.css">
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.4/jquery.js"></script>
    <link rel="stylesheet" href="editor.md/css/editormd.min.css">
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>
    <script src="./js/app.js"></script>


</head>
<body>
    <!-- 背景 -->
    <div class="nav">
            <!-- 头像 -->
        <img class src="./image/cat.webp" alt="头像">
        <div class="title">
            我的博客系统
        </div>
        <div class="spacer"></div>
        <a href="blog_list.html">主页</a>
        <a href="blog_edit.html">写博客</a>
        <a href="logout">注销</a>
    </div>
    <!-- 页面的主体部分 -->
    <div class="container">
        <!-- 左侧部分 -->
        <div class="container-left">
            <div class="card">

                <img src="./image/dog.jpg">
                <h3></h3>
                <a href="https://blog.csdn.net/xiaoyubuhuiqiche?spm=1000.2115.3001.5343" target="_blank">gitee</a>
                    <div class="conter">
                        <span>文章</span>
                        <span>分类</span>
                    </div>
                    <div class="conter">
                        <span class="article"></span>
                        <span class="sort"></span>
                    </div>
            </div>
    </div>

        <!-- 右侧部分 -->
        <div class="container-right">
            <div class="blog">
                <div class="title"></div>
                <div class="date"></div>
                <div class="desc" id="desc"></div>
            </div>
           
        </div>
    </div>
    <script>
       function getBlogId(){
        $.ajax({
            type:"get",
            url:"blog" + location.search,
            success : function(body){
                let containerDiv = document.querySelector('.container-right');
                let title = document.querySelector(".container-right .blog .title");
                title.innerHTML = body.title;
                let date = document.querySelector(".container-right .blog .date");
                date.innerHTML = body.postTime;
                let desc = document.querySelector(".container-right .blog .desc");
                editormd.markdownToHTML('desc',{markdown:body.content});
                   
            }
        })
        
       }
       getBlogId();
       checkLogin();
       getUser();
    </script>
</body>
</html>